home *** CD-ROM | disk | FTP | other *** search
- Path: dawn.mmm.com!news
- From: kjhopps@mmm.com (Kevin J Hopps)
- Newsgroups: comp.lang.c++
- Subject: Re: Exceptions vs. assertions
- Date: 2 Jan 1996 14:33:07 GMT
- Organization: 3M - St. Paul, MN 55144-1000 US
- Message-ID: <4cbfn3$kst@dawn.mmm.com>
- References: <4al1hn$73e@news.nstn.ca> <4bpt9b$cb5@news2.ios.com> <4bqb7t$bca@sundog.tiac.net> <4bsjqi$2t1k@tigger.cc.uic.edu>
- Reply-To: kjhopps@mmm.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Thadeus Olczyk (olczyk@sunphy1) wrote:
- > Chris Page (page@tiac.net) wrote:
- > : Exceptions do not cost anything until you use them. My rule of thumb
- > : is this: If I expect a condition to occur during normal operation of
-
- > Exceptions do cost, even if you don't use them. In fact one criteria of
- > quality of C++ compilers is the amount of overhead they incur for uncaught
- > exceptions.
-
- There are at least two kinds of cost to be considered -- time and space.
- For all the compilers I have investigated, it appears that they have traded
- space in favor of time -- executables using exceptions are larger than their
- return-value equivalents.
-
- As for time, the performance of exception throwing code versus equivalent
- error-returning code is nearly the same (for the systems I have checked) when
- no errors occur.
-
- As for the overhead incurred for uncaught exceptions, I think it does not
- matter, since the program will terminate anyway.
- --
- Kevin J. Hopps e-mail: kjhopps@mmm.com
- 3M Company phone: (612) 737-4643
- 3M Center, Bldg. 235-2D-57 fax: (612) 737-2700
- St. Paul, MN 55144-1000 Opinions are my own. I don't speak for 3M.
- But 3M speaks for me -- I did not write the following line:
-
- Opinions expressed herein are my own and may not represent those of 3M.
-